package cz.vutbr.feec.utko.ef.examples.sum;

import cz.vutbr.feec.utko.ef.evolution.Chromozome;
import cz.vutbr.feec.utko.ef.evolution.IFitnessEvaluator;

/**
 * The Class FitnessEvaluatorExample.
 */
public class FitnessEvaluatorExample implements IFitnessEvaluator {
	
	/** The counter. */
	private int counter = 0;

	/* (non-Javadoc)
	 * @see cz.vutbr.feec.utko.ef.evolution.IFitnessEvaluator#computeFitnessValue(cz.vutbr.feec.utko.ef.individuals.TreeChromozome)
	 */
	@Override
	public double computeFitnessValue(Chromozome i) {
		counter++;
		// get value of sum
		Integer d = (Integer) i.getResult();
		
		return d;
	}

	/* (non-Javadoc)
	 * @see cz.vutbr.feec.utko.ef.evolution.IFitnessEvaluator#getNumOfEvaluations()
	 */
	@Override
	public int getNumOfEvaluations() {
		return counter;
	}
}
